package cn.iocoder.ny.module.mall.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 商品规格
 */
@Data
@TableName(value = "mall_product_specification")
public class MallProductSpecification {

    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "ID不能为null", groups = Edit.class)
    private Long id;

    /**
     * 商品id
     */
    @TableField(value = "product_id")
    private Long productId;

    /**
     * 排序
     */
    @TableField(value = "sort")
    private Integer sort;

    /**
     * 是否显示  0：false  1:true
     */
    @TableField(value = "is_show")
    private Integer isShow;

    /**
     * 创建者
     */
    @TableField(value = "create_by")
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新者
     */
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 租户id
     */
    @TableField(value = "tenant_id")
    private Long tenantId;

    /**
     * 规格名称
     */
    @TableField(value = "spec_name")
    @NotBlank(message = "规格名称不能为空", groups = {Add.class, Edit.class})
    private String specName;

    /**
     * 规格值（价格）
     */
    @TableField(value = "spec_value")
    @NotNull(message = "规格值不能为空", groups = {Add.class, Edit.class})
    private String specValue;

    /**
     * 删除标记  0：false   1：true
     */
    @TableField(value = "del_flag")
    private Integer delFlag;

    /**
     * 商品库存
     */
    @TableField(value = "stock")
//    @NotNull(message = "商品库存不能为空", groups = {Add.class, Edit.class})
    private Integer stock;

    /**
     * 销售量
     */
    @TableField(value = "volume")
    private Integer volume;

    /**
     * 划线价
     */
    @TableField(value = "price_lining")
    private Integer priceLining;

    public interface Add {}
    public interface Edit {}

}
